﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using WebServer.Models;

namespace WebServer
{
    // 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码和配置文件中的接口名“IBar”。
    [ServiceContract]
    public interface IBar
    {
        #region 邮吧 [列表、根据ID查询、增/改、动作、排序]
        /// <summary>
        /// 邮吧
        /// </summary>
        /// <param name="PageSize">每页行数</param>
        /// <param name="Page">页码</param>
        /// <param name="Come">来源，全部为可能0或空</param>
        /// <param name="CenterID">根据来源来区分关联ID，默认为可能0或空</param>
        /// <param name="Code">藏品ID，默认为可能0或</param>
        /// <param name="UserID">登录用户ID【判断是否收藏，转发过】</param>
        /// <param name="IsUserID">登录用户ID【是否只查询自己的数据】</param>
        /// <param name="Commend">是否推荐</param>
        /// <param name="Img">是否强制有图片</param>
        /// <param name="IsTv">是否为直播</param>
        /// <param name="OrderInfo">排序条件</param>
        /// <param name="DescInfo">传入'Desc'降序,'Asc'升序,或者默认为空</param>
        /// <param name="IsDel">是否删除</param>
        /// <returns></returns>
        [OperationContract]
        List<Bar> NBarSearch(int PageSize, int Page, int Come, string CenterID, string Code, int UserID, int IsUserID, int UserCate, bool IsExpert, bool Commend, bool IsTv, int OrderInfo, bool DescInfo, int IsDel);

         /// <summary>
        /// 自己跟自己关注的人发的邮吧显示在前
        /// </summary>
        /// <param name="PageSize">每页行数</param>
        /// <param name="Page">页码</param>
        /// <param name="Come">来源，全部为可能0或空</param>
        /// <param name="CenterID">根据来源来区分关联ID，默认为可能0或空</param>
        /// <param name="Code">藏品ID，默认为可能0或</param>
        /// <param name="UserID">登录用户ID【判断是否收藏，转发过】</param>
        /// <param name="IsUserID">登录用户ID【是否只查询自己的数据】</param>
        /// <param name="Commend">是否推荐</param>
        /// <param name="Img">是否强制有图片</param>
        /// <param name="IsTv">是否为直播</param>
        /// <param name="OrderInfo">排序条件1-CreateTime/2-UserID/3-Come/4-Goods/5-Hits</param>
        /// <param name="DescInfo">传入'Desc'降序,'Asc'升序,或者默认为空</param>
        /// <param name="IsDel">是否删除</param>
        /// <returns></returns>
        [OperationContract]
        List<Bar> UBarSearch(int PageSize, int Page, int Come, string CenterID, string Code, int UserID, int IsUserID, int UserCate, bool IsExpert, bool Commend, bool IsTv, int OrderInfo, bool DescInfo, int IsDel);


        /// <summary>
        /// 可模糊查询邮吧
        /// </summary>
        /// <param name="PageSize">每页行数</param>
        /// <param name="Page">页码</param>
        /// <param name="Come">来源，全部为可能0或空</param>
        /// <param name="CenterID">根据来源来区分关联ID，默认为可能0或空</param>
        /// <param name="Code">藏品ID，默认为可能0或</param>
        /// <param name="UserID">登录用户ID【判断是否收藏，转发过】</param>
        /// <param name="Text">内容</param>
        /// <param name="Commend">是否推荐</param>
        /// <param name="Img">是否强制有图片</param>
        /// <param name="IsTv">是否为直播</param>
        /// <param name="OrderInfo">排序条件1-CreateTime/2-UserID/3-Come/4-Goods/5-Hits</param>
        /// <param name="DescInfo">传入'Desc'降序,'Asc'升序,或者默认为空</param>
        /// <param name="IsDel">是否删除</param>
        /// <returns></returns>
        [OperationContract]
        List<Bar> MBarSearch(int PageSize, int Page, int Come, string CenterID, string Code, int UserID,  string Text, int UserCate, bool IsExpert, bool Commend, bool IsTv, int OrderInfo, bool DescInfo, int IsDel);

        
        /// <summary>
        /// 可模糊查询指定多人的邮吧
        /// </summary>
        /// <param name="PageSize">每页行数</param>
        /// <param name="Page">页码</param>
        /// <param name="Come">来源，全部为可能0或空</param>
        /// <param name="CenterID">根据来源来区分关联ID，默认为可能0或空</param>
        /// <param name="Code">藏品ID，默认为可能0或</param>
        /// <param name="UserID">登录用户ID【判断是否收藏，转发过】</param>
        /// <param name="IsUserID">是否根据用户查询</param>
        /// <param name="Text">内容</param>
        /// <param name="Commend">是否推荐</param>
        /// <param name="Img">是否强制有图片</param>
        /// <param name="IsTv">是否为直播</param>
        /// <param name="OrderInfo">排序条件1-CreateTime/2-UserID/3-Come/4-Goods/5-Hits</param>
        /// <param name="DescInfo">传入'Desc'降序,'Asc'升序,或者默认为空</param>
        /// <param name="IsDel">是否删除</param>
        /// <returns></returns>
        [OperationContract]
        List<Bar> EBarSearch(int PageSize, int Page, int Come, string CenterID, string Code, int UserID, string IsUserID, string Text, int UserCate, bool IsExpert, bool Commend, bool IsTv, int OrderInfo, bool DescInfo, int IsDel);


        
        /// <summary>
        /// 邮吧总数
        /// </summary>
        /// <param name="Come"></param>
        /// <param name="CenterID"></param>
        /// <param name="Code"></param>
        /// <param name="UserID"></param>
        /// <param name="Text"></param>
        /// <param name="UserCate"></param>
        /// <param name="IsExpert"></param>
        /// <param name="Commend"></param>
        /// <param name="IsTv"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        int EBarCount(int Come, string CenterID, string Code, int UserID, string IsUserID, string Text, int UserCate, bool IsExpert, bool Commend, bool IsTv, int IsDel);
        
        /// <summary>
        /// 手机可模糊查询邮吧
        /// </summary>
        /// <param name="OpenTime">开始时间</param>
        /// <param name="EndTime">截止时间</param>
        /// <param name="PageSize">每页行数</param>      
        /// <param name="Come">来源，全部为可能0或空</param>
        /// <param name="CenterID">根据来源来区分关联ID，默认为可能0或空</param>
        /// <param name="Code">藏品ID，默认为可能0或</param>
        /// <param name="UserID">登录用户ID【判断是否收藏，转发过】</param>
        /// <param name="Text">内容</param>
        /// <param name="UserCate">用户类型，0-普通，1-分析师，2-经济商</param>
        /// <param name="IsExpert">0为不是专家，1为专家，-1为全部</param>
        /// <param name="Commend">0为未推荐，1为已推荐，-1为全部</param>    
        /// <param name="IsTv">0为不是直播，1为直播，-1为全部</param>
        /// <param name="OrderInfo">排序条件1-CreateTime/2-UserID/3-Come/4-Goods/5-Hits</param>
        /// <param name="DescInfo">传入'Desc'降序,'Asc'升序,或者默认为空</param>
        /// <param name="IsDel">0为未删除，1为已删除，-1为全部</param>
        /// <returns></returns>
        [OperationContract]
        List<Bar> PBarSearch(string OpenTime, string EndTime, int PageSize, int Come, string CenterID, string Code, int UserID,int IsUser, string Text, int UserCate, int IsExpert, int Commend, int IsTv, int OrderInfo, bool DescInfo, int IsDel);


        /// <summary>
        /// 邮吧总数
        /// </summary>
        /// <param name="Come"></param>
        /// <param name="CenterID"></param>
        /// <param name="Code"></param>
        /// <param name="UserID"></param>
        /// <param name="Text"></param>
        /// <param name="UserCate"></param>
        /// <param name="IsExpert"></param>
        /// <param name="Commend"></param>
        /// <param name="IsTv"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        int MBarCount(int Come, string CenterID, string Code, int UserID, string Text, int UserCate, bool IsExpert, bool Commend, bool IsTv, int IsDel);

        /// <summary>
        /// 根据邮吧ID获取信息
        /// </summary>
        /// <param name="ID">邮吧ID</param>
        /// <param name="UserID">用户ID</param>
        /// <returns></returns>
        [OperationContract]
        Bar GetBarByID(int? ID = 0, int? UserID = 0);

        /// <summary>
        /// 新增或者修改邮吧
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [OperationContract]
        int AddOrUpBar(Bar model);


        /// <summary>
        /// 邮吧动作
        /// </summary>
        /// <param name="ID">邮吧ID</param>
        /// <param name="Filed">列名</param>
        /// <param name="Fn">值</param>
        /// <returns></returns>
        [OperationContract]
        int BarAction(int ID, string Filed, bool Fn);


          /// <summary>
        /// 邮吧排序
        /// </summary>
        /// <param name="Size">显示多少行</param>
        /// <param name="Sort">排序1-ID，2-创建时间，3-修改时间，4-转发总数，5-回复总数，默认点击总数</param>
        /// <param name="Desc">是否倒序</param>
        /// <returns></returns>
        [OperationContract]
        List<Bar> NBarSort(int Size, int Sort, bool Desc);

        #endregion


        #region 邮吧回复列表、增
         /// <summary>
        /// 邮吧回复列表
        /// </summary>
        /// <param name="PageSize">，每页行数</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="BarID">邮吧ID</param>
        /// <param name="UserID">用户ID</param>
        /// <param name="OrderInfo">排序条件</param>
        /// <param name="DescInfo">传入'Desc'降序,'Asc'升序,或者默认为空</param>
        /// <param name="IsDel">是否删除</param>
        /// <returns></returns>
        [OperationContract]
        List<BarReply> NBarReplySearch(int PageSize, int PageIndex, int BarID, int UserID, int OrderInfo, string DescInfo, int IsDel);
        
        /// <summary>
        /// 邮吧回复列表
        /// </summary>
        /// <param name="PageSize">，每页行数</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="BarID">邮吧ID</param>
        /// <param name="UserID">用户ID</param>
        /// <param name="OrderInfo">排序条件</param>
        /// <param name="DescInfo">传入'Desc'降序,'Asc'升序,或者默认为空</param>
        /// <param name="IsDel">是否删除</param>
        /// <returns></returns>
        [OperationContract]
        List<BarReply> PBarReplySearch(string OpenTime = "", string EndTime = "", int PageSize = 8, int BarID = 0, int UserID = 0, int OrderInfo = 0, string DescInfo = "", int IsDel = 0);

             /// <summary>
        ///  邮吧回复总数
        /// </summary>
        /// <param name="BarID"></param>
        /// <param name="UserID"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        int NBarReplyCount(int BarID, int UserID, int IsDel);

        /// <summary>
        /// 回复邮吧
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        [OperationContract]
        int ReplyBar(BarReply entity);


        /// <summary>
        /// 删除回复信息
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        int DelRelyBar(int ID);

             /// <summary>
        /// 根據Id獲取郵吧回復
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        BarReply ReplyBarByID(int ID = 0);
        #endregion


        #region 直播室
         /// <summary>
        /// 直播室内人员列表
        /// </summary>
        /// <param name="DtTime"></param>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <param name="UserId"></param>
        /// <param name="UserName"></param>
        /// <param name="BarID"></param>
        /// <param name="Order">默认根据时间排序，1-ID，2-USerID，3-BarID</param>
        /// <param name="Desc"></param>
        /// <returns></returns>
        [OperationContract]
        List<UToLive> ToLiveList(int PageSize, int PageIndex, int UserId, string UserName, int BarID, int DtTime, int Order, bool Desc);

         /// <summary>
        /// 进入直播室
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        [OperationContract]
        int ToLiveSet(UToLive entity);


        
        /// <summary>
        /// 退出直播室
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="UserName"></param>
        /// <param name="BarID"></param>
        /// <returns></returns>
        [OperationContract]
        int ToLiveOut(int UserID, string UserName, int BarID);

        /// <summary>
        ///热门直播室
        /// </summary>
        /// <param name="where"></param>
        /// <returns></returns>
        [OperationContract]
        List<Bar> getHotLiveRoom(int pageSize, int PageIndex);


        /// <summary>
        ///首次直播内容
        /// </summary>
        /// <param name="Userid"></param>
        /// <param name="BarID"></param>
        /// <param name="Order">默认根据时间排序，1-barid，2-userid</param>
        /// <returns></returns>
        [OperationContract]
        List<BarReply> HomeLiveTalk(int Userid, string UserName, int BarID, int Top, int Order, bool Desc, bool IsDel);

        /// <summary>
        ///刷新直播内容
        /// </summary>
        /// <param name="Userid"></param>
        /// <param name="BarID"></param>
        /// <param name="Order">默认根据时间排序，1-barid，2-userid</param>
        /// <returns></returns>
        [OperationContract]
        List<BarReply> LiveTalkB(string beginTime, int Userid, string UserName, int BarID, int Top, int Order, bool Desc, bool IsDel);


          /// <summary>
        ///历史直播内容
        /// </summary>
        /// <param name="Userid"></param>
        /// <param name="BarID"></param>
        /// <param name="Order">默认根据时间排序，1-barid，2-userid</param>
        /// <returns></returns>
        [OperationContract]
        List<BarReply> LiveTalkE(string endTime, int Userid, string UserName, int BarID, int Top, int Order, bool Desc, bool IsDel);

         /// <summary>
        ///直播内容
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <param name="Userid"></param>
        /// <param name="BarID"></param>
        /// <param name="Order">默认根据时间排序，1-barid，2-userid</param>
        /// <returns></returns>
        [OperationContract]
        List<BarReply> MasterLive(int PageSize, int PageIndex, int Userid, int BarID, int Order, bool Desc, bool IsDel);


        /// <summary>
        /// 播主对某人禁言
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="UserName"></param>
        /// <param name="BarID"></param>
        /// <param name="Fild"></param>
        /// <param name="Fn"></param>
        /// <returns></returns>
        [OperationContract]
        int BannedPeo(int ID,int UserID, string UserName, int BarID, string Fild, bool Fn);

          /// <summary>
        /// 是否被禁用
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="UserName"></param>
        /// <param name="BarID"></param>
        /// <returns></returns>
        [OperationContract]
        int IfBanned(int UserID, string UserName, int BarID);

         /// <summary>
        /// 历史直播室
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="Page"></param>
        /// <param name="UserID"></param>
        /// <param name="Commend"></param>
        /// <param name="OrderInfo"></param>
        /// <param name="DescInfo"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        List<Bar> HistoryLiveByUserID(int PageSize, int Page, int UserID, bool Commend, int OrderInfo, bool DescInfo, int IsDel);

           /// <summary>
        /// 历史直播总数
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="Commend"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        int HistoryLiveCountByUserID(int UserID, bool Commend, int IsDel);

        /// <summary>
        /// 新增或者修改直播室
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [OperationContract]
        int AddOrUpLive(Bar model);

        /// <summary>
        /// 显示被禁止发言人的信息
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <param name="IsBanned"></param>
        /// <param name="UserName"></param>
        /// <param name="Order"></param>
        /// <param name="Desc"></param>
        /// <returns></returns>
        [OperationContract]
        List<UToLive> AuditList(int PageSize, int PageIndex, int IsBanned, string UserName, int Order, bool Desc);


        /// <summary>
        /// 显示被禁止发言人的信息总数
        /// </summary>
        /// <param name="IsBanned"></param>
        /// <param name="UserName"></param>
        /// <returns></returns>
        [OperationContract]
        int AuditCount(int IsBanned = 2, string UserName = "");


            /// <summary>
        /// 给邮吧添加游客
        /// </summary>
        /// <param name="BarID"></param>
        /// <param name="Count"></param>
        /// <param name="CreaTime"></param>
        /// <returns></returns>
        [OperationContract]
        int AuditAdd(int BarID, int Count, DateTime CreaTime);


          /// <summary>
        /// 根据博主是否在，判断直播显示开启或关闭
        /// </summary>
        /// <param name="BarID"></param>
        /// <returns></returns>
        [OperationContract]
        int LiveExp(int BarID, int IsExp);

        #endregion

        #region 其他评论产生的邮吧列表
        /// <summary>
        /// 手机可模糊查询评论列表
        /// </summary>
        /// <param name="OpenTime">开始时间</param>
        /// <param name="EndTime">截止时间</param>
        /// <param name="PageSize">每页行数</param>      
        /// <param name="Come">来源，全部为可能0或空</param>
        /// <param name="CenterID">根据来源来区分关联ID，默认为可能0或空</param>
        /// <param name="Code">藏品ID，默认为可能0或</param>
        /// <param name="UserID">登录用户ID【判断是否收藏，转发过】</param>
        /// <param name="Text">内容</param>
        /// <param name="UserCate">用户类型，0-普通，1-分析师，2-经济商</param>
        /// <param name="IsExpert">0为不是专家，1为专家，-1为全部</param>
        /// <param name="Commend">0为未推荐，1为已推荐，-1为全部</param>    
        /// <param name="IsTv">0为不是直播，1为直播，-1为全部</param>
        /// <param name="OrderInfo">排序条件1-CreateTime/2-UserID/3-Come/4-Goods/5-Hits</param>
        /// <param name="DescInfo">传入'Desc'降序,'Asc'升序,或者默认为空</param>
        /// <param name="IsDel">0为未删除，1为已删除，-1为全部</param>
        /// <returns></returns>
        [OperationContract]
        List<Bar> PreplyList(string OpenTime, string EndTime, int PageSize, int Come, string CenterID, string Code, int UserID, int IsUser, string Text, int UserCate, int IsExpert, int Commend, int IsTv, int OrderInfo, bool DescInfo, int IsDel);
        #endregion


        #region 新的直播【邮吧回复】
        /// <summary>
        /// 新直播
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        [OperationContract]
        int NLiveAdd(BarReply entity);



        /// <summary>
        /// 新的直播列表
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="MaxID"></param>
        /// <param name="MinID"></param>
        /// <param name="Order">1-向上【比maxID大的数据】,2-向下【比minID小的数据】</param>
        /// <param name="LiveID"></param>
        /// <param name="IsDel"></param>
        /// <returns></returns>
        [OperationContract]
        List<BarReply> NLiveSearch(int PageSize, int MaxID, int MinID, int Order, int LiveID, int IsDel);
        #endregion
    }
}
